
pkgname=gpm
pkgver=1.20.7
pkgrel=5
pkgdesc="A mouse server for the console and xterm"
arch=('x86_64')
url="http://unix.schottelius.org/gpm/"
license=('GPL')
depends=('ncurses' 'bash')
options=('!makeflags')
source=("http://www.nico.schottelius.org/software/gpm/archives/${pkgname}-${pkgver}.tar.lzma"
        'gpm.sh'
        'gpm.service')
md5sums=('fa8a6fe09826896625ca557ac5e42ed7'
         'e391fe4599ce102615f9cd449c380d41'
         '5e5547fb272befeeb8bcb07fa2426c5e')

build() {
  cd ${pkgname}-${pkgver}
  
  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  
  install -D -m755 ../gpm.sh ${pkgdir}/etc/profile.d/gpm.sh
  install -D -m644 ../gpm.service ${pkgdir}/usr/lib/systemd/system/gpm.service

# library fixes
  cd ${pkgdir}/usr/lib/
  ln -s libgpm.so.2.* libgpm.so
  chmod 755 ${pkgdir}/usr/lib/libgpm.so.*
}
